<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Logare</title>
</head>

<body>

<?php
$con = mysql_connect('localhost','root','parola');
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db('anc', $con);

$parola=$_POST['parola'];
$user=$_POST['email'];


$sql="
SELECT * 
FROM admin
WHERE email='$user' AND parola='$parola'";
$result=mysql_query($sql);

$count=mysql_num_rows($result);


if ($count==1){
     session_start();
     session_register("user");
	 session_register("parola");
	 
	$_SESSION['user']=$user;
	$_SESSION['parola']=$parola;
	 
	 header("location:login_succes.php");
	 }
else {
	 echo "User inexistent sau parola gresita!";
	 }


	 
mysql_close($con);
?>


</body>
</html>
